package com.sbhotel.chotellauncher.constant;

import android.os.Environment;

import com.sbhotel.chotellauncher.MyApplication;
import com.sbhotel.chotellauncher.R;
import com.sbhotel.chotellauncher.entity.AppBean;
import com.sbhotel.chotellauncher.entity.HomeMenuBean;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class Constants {

    public static String CONTROLER = "0000";
    // 縮放比率
    public static final float SCALE_RATE = 1.00f;
    //LOG TAG
    public static final String LOG_TAG = "showboom";

    public static final String UI_VERSION = "2.0.0";
    public static final String INTEREFACT_VERSION = "2.1.0";

    public static final String DEVICE_MODEL = "65D2060GD";
    public static final String PRO = "CH65";

    public static final int HOME_KEY_CODE = 4124;

    //config path
    public static final String CONFIG_FILE_PATH = MyApplication.getApplication().getFilesDir().getAbsolutePath() + File.separator + "config";
    public static final String CONFIG_FILE_OK_PATH = MyApplication.getApplication().getFilesDir().getAbsolutePath() + File.separator + "config_ok";

    //酒店信息接口
    public static final String MAIN_URL = "http://api-ui.showboom.cn/?con=api&ac=index";
    //数据上报接口
    public static final String REPORT_URL = "http://data-ui.showboom.cn/?con=api&ac=index";
    //心跳接口
    public static final String HEART_URL = "http://data-ui.showboom.cn/?con=api&ac=heart";

    public static final String ACTION_POWER_OFF = "com.hotel.alarm_power_off";
    public static final String ACTION_HOME_KEY = "com.changhong.system.systemkeyfor3rd";
    public static final String ACTION_UPGRADE = "com.sbhotel.action.upgrade";

    //SP KEY
    public static final String SP_KEY_HOTEL_NAME = "hotel_name";
    public static final String SP_KEY_HOTEL_LOGO = "hotel_logo";
    public static final String SP_KEY_SLEEP_VALUE = "sleep_value";
    public static final String SP_KEY_DEVICE_UN_CODE = "device_un";
    public static final String SP_KEY_IS_LOCK = "device_is_lock";
    public static final String SP_KEY_UN_MARK = "un_mark";
    public static final String SP_KEY_GROUP_NAME = "group_name";


    public static final String SP_KEY_NET_ERROR = "net_error";

    public static final String SP_KEY_CURRENT_CONF_VERSION = "current_config_version";

    public static final int main_ment_imgs[] = {
            R.mipmap.tv,
            R.mipmap.main_menu_02,
            R.mipmap.main_menu_03,
            R.mipmap.main_menu_04,
            R.mipmap.main_menu_05,
            R.mipmap.main_menu_06,
            R.mipmap.main_menu_07,
            R.mipmap.main_menu_08};

    //////// bottom menu info
    public static final int bottom_ment_imgs[] = {R.mipmap.smarthealth, R.mipmap.control, R.mipmap.service,
            R.mipmap.checkout, R.mipmap.setting, R.mipmap.airplay};
    public static final String bottom_ment_title[] = {"智能健康", "智能控制", "客房服务", "快速退房", "个性设置", "多屏互动"};

    public static final String[] SLEEP_TURN_OFF_VALUE = {"关闭", "30分钟", "60分钟", "90分钟"};

    //report id
    public static final String CODE_MAIN_MENU_1 = "101100";
    public static final String CODE_MAIN_MENU_2 = "101200";
    public static final String CODE_MAIN_MENU_3 = "101300";
    public static final String CODE_MAIN_MENU_4 = "101400";
    public static final String CODE_MAIN_MENU_5 = "101500";
    public static final String CODE_MAIN_MENU_6 = "101600";
    public static final String CODE_MAIN_MENU_7 = "101700";
    public static final String CODE_MAIN_MENU_8 = "101800";

    public static final String CODE_MAIN_BOTTOM_MENU_1 = "102100";
    public static final String CODE_MAIN_BOTTOM_MENU_2 = "102200";
    public static final String CODE_MAIN_BOTTOM_MENU_3 = "102300";
    public static final String CODE_MAIN_BOTTOM_MENU_4 = "102400";
    public static final String CODE_MAIN_BOTTOM_MENU_5 = "102500";
    public static final String CODE_MAIN_BOTTOM_MENU_6 = "102600";

    public static final String CODE_SETTINGS_SLEEP_MENU = "102510";
    public static final String CODE_SETTINGS_SYSINFO_MENU = "102520";

    public static final String CODE_MSG_BUTTON = "103100";
    public static final String CODE_AD_DISPLAY = "104100";

    public static final String ACTION_CONFIG_OK = "com.sbhotel.config.success";

    /**
     * 初始化主菜单数据
     *
     * @return
     */
    public static List<HomeMenuBean> initHomeMenuData() {
        List<HomeMenuBean> list = new ArrayList<>();
        HomeMenuBean bean;
        for (int i = 0; i < main_ment_imgs.length; i++) {
            bean = new HomeMenuBean();
            bean.setImgId(main_ment_imgs[i]);
            list.add(bean);
        }
        return list;
    }

    /**
     * 初始化主页底部菜单数据
     *
     * @return
     */
    public static List<AppBean> initHomeBottomMenuData() {
        List<AppBean> list = new ArrayList<>();
        AppBean bean;
        for (int i = 0; i < bottom_ment_imgs.length; i++) {
            bean = new AppBean();
            bean.setName(bottom_ment_title[i]);
            bean.setIconId(bottom_ment_imgs[i]);
            list.add(bean);
        }
        return list;
    }
}
